﻿package mortal.game.view.mainUI.smallMap.view.typeIconDataParser
{
    import Message.BroadCast.*;
    import Message.Public.*;
    import extend.language.*;
    import mortal.game.cache.*;
    import mortal.game.resource.*;
    import mortal.game.scene3D.player.entity.*;
    import mortal.game.utils.*;
    import mortal.game.view.mainUI.smallMap.view.data.*;

    public class SmallMap_GuildWarParser extends Object implements ISMallMapTyperIconDataParser
    {
        public static var instance:SmallMap_GuildWarParser = new SmallMap_GuildWarParser;

        public function SmallMap_GuildWarParser()
        {
            return;
        }// end function

        public function chooseIcon(param1:IEntity, param2:Array) : void
        {
            var _loc_3:* = new SmallMapTypeIconData();
            _loc_3.x = param1.x2d;
            _loc_3.y = param1.y2d;
            _loc_3.name = "";
            _loc_3.tips = "";
            var _loc_4:* = Cache.instance.role.entityInfo.force;
            var _loc_5:* = param1.entityInfo.entityInfo;
            var _loc_6:* = _loc_5.entityId.type == EEntityType._EEntityTypePlayer;
            var _loc_7:* = _loc_5.ownerEntityId && _loc_5.ownerEntityId.id != 0;
            if (_loc_6)
            {
                if (EntityRelationUtil.isFriend(_loc_5))
                {
                    _loc_3.iconName = ImagesConst.MapPoint_FriendPoint;
                    param2.push(_loc_3);
                }
            }
            else if (!_loc_7)
            {
                if (_loc_5.force == EForce._EForceNormal)
                {
                    _loc_3.iconName = ImagesConst.MapPointTowerYellow;
                    _loc_3.tips = Language.getString(21281);
                }
                else if (_loc_4 == _loc_5.force)
                {
                    _loc_3.iconName = ImagesConst.MapPointTowerGreen;
                    _loc_3.tips = Language.getString(21282);
                }
                else
                {
                    _loc_3.iconName = ImagesConst.MapPointTowerRed;
                    _loc_3.tips = Language.getStringByParam(21283, _loc_5.guildName);
                }
                _loc_3.y = param1.y2d - 200;
                param2.push(_loc_3);
            }
            return;
        }// end function

    }
}
